1. Field of the Invention
The present invention relates to a network device in a data network and more particularly to the mirroring of data received by a network device.
2. Description of the Related Art
A packet switched network may include one or more network devices, such as an Ethernet switching chip, each of which includes several modules that are used to process information that is transmitted through the device. Specifically, the device includes an ingress module, a Memory Management Unit (MMU) and an egress module. The ingress module includes switching functionality for determining to which destination port a packet should be directed. The MMU is used for storing packet information and performing resource checks. The egress module is used for performing packet modification and for transmitting the packet to at least one appropriate destination port. One of the ports on the device may be a CPU port that enables the device to send and receive information to and from external switching/routing control entities or CPUs.
As part of the management of the network device, often the packet flow needs to be monitored to determine if the network device is functioning properly. In prior art devices, the packets being sent to a given port could be “mirrored” to another port where the packet flow could be examined. The mirroring process is important in that the flow of the packets to a given destination port need not be interrupted to examine the flow to that destination port. The packets that are received by the “mirrored-to” port are examined at the latter port with no disruption to the flow of packets to the actual destination port.
Previously, for most prior art network devices, for a destination or source port, only one mirrored-to port could be specified. Given that mirroring was primarily used for monitoring of traffic received by that port, having multiple mirrored-to ports was not needed. However, mirroring has been used more recently to allow for other operations than mere static monitoring. Thus, there is a need for a network device to mirror packets to multiple ports.
Additionally, the packet that was mirrored was modified as a consequence of its being forwarded. Thus, if a packet received at a given port of a network device is forwarded to another port, the header may be modified to aid in that forwarding operation. However, if that receiving port is supposed to mirror packets to another mirrored-to port, the packet that is forwarded to the destination port is not the same as the packet that the receiving port received. This can be a problem if a copy of the received packet is what is needed at the mirrored-to port.